-
Notifications
You must be signed in to change notification settings - Fork 0
Relationships Management Tools #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…xplorer when there are more than one models in the file.
…code-extension into relationshipsManagement
…rom the source file correctly.
…ontroller. Adds multiple fields handling in the RefactorController. Adds some code refactors and utility methods in addField.ts and addComposition.ts
… the creation of edit in every refactor command.
…pdated explorer to detect new 'Composition' decorators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces a comprehensive suite of tools for managing field extraction and relationship conversions in Slingr models. The tools provide developers with powerful refactoring capabilities to restructure their data models efficiently.
- Field extraction tools for creating parent, embedded, reference, and composition models from existing fields
- Relationship conversion tools for changing between reference and composition patterns
- Enhanced relationship creation tools with new composition and reference capabilities
Reviewed Changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/test/ |
Updated test files to correct model inheritance, add comprehensive test coverage for new tools, and remove obsolete tests |
src/services/ |
Enhanced source code service with model manipulation, enum handling, and datasource import capabilities |
src/refactor/tools/ |
Added relationship conversion tools and updated existing tools with confirmation dialogs |
src/commands/ |
Implemented new field extraction and relationship management commands with command helper abstractions |
src/explorer/ |
Enhanced tree view with multi-selection support and better field type visualization |
src/cache/ |
Added utility methods for model lookup and datasource filtering |
Comments suppressed due to low confidence (2)
src/commands/fields/changeReferenceToComposition.ts:1
- There's corrupted text in the success message. The line appears to have been corrupted during editing, with partial method signature mixed into the string literal.
import * as vscode from "vscode";
src/services/sourceCodeService.ts:1
- The import path uses a hardcoded 'datasource' filename instead of using the actual dataSource name variable. This should be
'../dataSources/${dataSource}'to correctly import the specific datasource.
import * as vscode from "vscode";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/commands/models/addReference.ts
Outdated
| lines.push(`\t@Field({})`); | ||
| lines.push(`\t@Field({})`); |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing closing brace for the second @field decorator on line 357. This will result in invalid TypeScript syntax.
| lines.push(`\t@Field({})`); | |
| lines.push(`\t@Field({})`); |
| lines.push(`\t@UUID()`); | ||
| lines.push(`\t@PrimaryKey()`); |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Let's adjust this so by default the ID of persistent models have this definition: export class Test extends BaseModel {
@Field({
primaryKey: true
})
@UUID({
generated: true
})
id!: string
} |
…del definition and updated some commands to use this.
[FEAT] [NO ISSUE] Add support for MySQL and PostgreSQL
Field and Model Relationship Management Tools
This pull request introduces a comprehensive suite of tools for managing field extraction and relationship conversions in Slingr models. These tools provide developers with powerful refactoring capabilities to restructure their data models efficiently.
New Tools Added
Field Extraction Tools
Extract Fields to Parent (
extractFieldsToParent.ts)Extract Fields to Embedded (
extractFieldsToEmbedded.ts)Extract Fields to Reference (
extractFieldsToReference.ts)Extract Fields to Composition (
extractFieldsToComposition.ts)Relationship Conversion Tools
Change Reference to Composition (
changeReferenceToComposition.ts)Change Composition to Reference (
changeCompositionToReference.ts)Relationship Creation Tools
Add Reference (
addReference.ts)Add Composition (
addComposition.ts)Benefits
These tools significantly enhance the Slingr development experience by providing powerful model refactoring capabilities that maintain code quality and project integrity.